﻿@model IList<jianvgroup.com.Models.AccountViewModels.MangerUserViewModel>

@section Heads {
    <link rel="stylesheet" type="text/css" href="~/lib/css/plugins/select2/select2.css" />
    <link rel="stylesheet" type="text/css" href="~/lib/css/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" />
}

<div class="page-content-wrapper">
    <div class="page-content">
        <!-- BEGIN PAGE HEADER-->
        <div class="page-bar">
            <ul class="page-breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="/home">首页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="/mangeruser">管理员</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">列表</a>
                </li>
            </ul>
        </div>
        <h3 class="page-title">
            管理员 <small>列表</small>
        </h3>

        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box grey-cascade">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-globe"></i>管理员列表
                        </div>
                    </div>
                    <div class="portlet-body">
                        <table class="table table-striped table-bordered table-hover" id="mangerusersList">
                            <thead>
                                <tr>
                                    <th class="table-checkbox">
                                        <input type="checkbox" class="group-checkable" data-set="#bannerList .checkboxes" />
                                    </th>
                                    <th>
                                        用户名
                                    </th>
                                    <th>
                                        角色
                                    </th>

                                    <th>
                                        操作
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                @if (Model != null && Model.Any())
                                {
                                    foreach (var item in Model)
                                    {
                                        <tr class="odd gradeX">
                                            <td>
                                                <input type="checkbox" class="checkboxes" value="1" />
                                            </td>
                                            <td>
                                                @item.UserName
                                            </td>
                                            <td>
                                                @item.RoleName
                                            </td>
                                            <td>
                                                <a href="/mangeruser/Create/@item.UserId" class="btn default btn-xs purple">
                                                    <i class="fa fa-edit"></i> 编辑
                                                </a>
                                                <a onclick="return confirm('您确定要删除吗？')" href="/mangeruser/Delete/@item.UserId" c class="btn default btn-xs black remove">
                                                    <i class="fa fa-trash-o"></i> 删除
                                                </a>
                                            </td>
                                        </tr>
                                    }
                                }
                            </tbody>
                        </table>
                        @Html.Partial("_BasePager", ViewData["pageModel"])
                    </div>
                </div>
                <!-- END EXAMPLE TABLE PORTLET-->
            </div>
        </div>
        <!-- END PAGE CONTENT-->
    </div>
</div>
@section Scripts {
    <script type="text/javascript" src="~/lib/css/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="~/lib/css/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
    <script src="~/scripts/mangeruser.js"></script>
    <script>
        jQuery(document).ready(function () {
            Metronic.init(); // init metronic core componets
            Layout.init(); // init layout
            MangerUsersList.init();
            $(".page-sidebar-menu li:nth-child(3) .title").after("<span class='selected'></span>");
            $(".page-sidebar-menu li:nth-child(3) .arrow").addClass("open");
            $(".page-sidebar-menu li:nth-child(3)").addClass("active open");
            $(".page-sidebar-menu li:nth-child(3) .sub-menu li:nth-child(1)").addClass("active");
        });
    </script>
}